#ifndef G3_GRAHAM_SCAN_H
#define G3_GRAHAM_SCAN_H

#include "log.h"

#include "m_vector.h"

#include <set>
#include <vector>

namespace G3 {

using std::multiset;
using std::vector;

// A helper class for slope sorting
class GRAHAM_ANGLE2F {
	public:
		GRAHAM_ANGLE2F (ushort VertexID = 0, float Angle = 0.0f, float Distance = 0.0f);

		ushort VertexID;
		float Angle;
		float Distance;

		bool operator< (const GRAHAM_ANGLE2F &GrahamAngle) const;
};

// Class for a VEC2F Graham Scan
class GRAHAM_SCAN2F {
	public:
        GRAHAM_SCAN2F ();
        ~GRAHAM_SCAN2F ();

		G3::VEC2F *VertexList;
		vector<ushort> Indices;
		ushort NumVertices;

//==============================================================================
// Performs a Graham Scan on the list of vertices
//==============================================================================
		bool Scan (G3::VEC2F *Vertices, int NumVerts);
};

}

#endif
